Skip to content

feat: add a Surreal Eloquent query foundation#118

Merged
ibourgeois merged 8 commits intomainfrom
codex/feat-117-surreal-eloquent-driver
Mar 24, 2026
Merged

feat: add a Surreal Eloquent query foundation#118
ibourgeois merged 8 commits intomainfrom
codex/feat-117-surreal-eloquent-driver

Conversation

@ibourgeois
Copy link
Contributor

Summary

  • turn the surreal database connection into a real data connection instead of a schema-only shim
  • add a Surreal query builder that supports the core Eloquent operations needed for standard model usage
  • prove the new path with a real User Eloquent test on DB_CONNECTION=surreal

Verification

  • vendor/bin/pint --dirty --format agent
  • php artisan test --compact tests/Unit/SurrealHttpClientTest.php tests/Feature/SurrealSchemaDriverTest.php tests/Feature/SurrealWorkspaceModelTest.php tests/Feature/SurrealEloquentDriverTest.php

Closes #117

Copilot AI review requested due to automatic review settings March 23, 2026 23:37
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an initial SurrealDB-backed Laravel Query Builder / Eloquent foundation so the surreal connection can be used for standard model workflows (e.g., User::query()), with a feature test proving basic CRUD against a real Surreal runtime.

Changes:

  • Introduces a custom SurrealQueryBuilder and wires it into SurrealSchemaConnection::query().
  • Extends SurrealSchemaConnection to execute select/insert/update/delete operations via SurrealQL over SurrealHttpClient.
  • Adds a feature test that boots a local Surreal instance and validates common User Eloquent operations on DB_CONNECTION=surreal.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 10 comments.

File Description
tests/Feature/SurrealEloquentDriverTest.php Proves core Eloquent CRUD/lookup behavior works on the surreal connection using a real local Surreal runtime.
app/Services/Surreal/Schema/SurrealSchemaConnection.php Adds query execution + record CRUD helpers, plus wiring for a custom query builder and default query grammar/processor.
app/Services/Surreal/Query/SurrealQueryBuilder.php Implements minimal Query Builder overrides (get/insert/insertGetId/update/delete/exists/count) backed by SurrealSchemaConnection helpers.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ibourgeois ibourgeois merged commit 131da75 into main Mar 24, 2026
1 check passed
@ibourgeois ibourgeois deleted the codex/feat-117-surreal-eloquent-driver branch March 24, 2026 06:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: build a true Laravel Eloquent and query driver for SurrealDB

2 participants